<template>
    <div>
        <el-dialog title="投诉处理方式" :visible.sync="dialogVisible" @close="closeEdit(false)" width="800px">
            <el-form :model="productForm" ref="productForm" label-width="120px" style="width: 90%;">
                <el-row :gutter="40">
                    <el-col :span="24">
                        <el-form-item label="处理方式说明" prop="remark">
                            <el-input v-model="productForm.remark" type="textarea" :rows="3"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="closeEdit(false)">取 消</el-button>
                <SubmitButton type="primary" size="" :ref-form="()=>{return this.$refs['productForm']}"
                              :post-option="{url: checkPassUrl, data: productForm, callback: checkCB }">
                    已处理
                </SubmitButton>
            </div>

        </el-dialog>

    </div>

</template>


<script>

    import SubmitButton from '../common/SubmitButton'
    import SystemConfig from "~/api/SystemConfig";

    export default {
        components: {
            SubmitButton
        },
        data() {
            return {
                status: 1,
                productForm: {
                    id: 0,
                    complainType: 0,
                    remark: '',
                },
                checkPassUrl: SystemConfig.URL_MARK_PROCESSED,
            }
        },
        props: ['isShow', 'activityObj'],
        computed: {
            dialogVisible: {
                get: function () {
                    return this.isShow;
                },
                set: function (val) {
                }
            }
        },
        watch: {
            dialogVisible: function (newVal, oldVal) {
                if (newVal) {
                    this.productForm.id = this.activityObj.id;
                    this.productForm.complainType = this.activityObj.complain_type;
                }
            }
        },
        created() {
        },
        methods: {
            checkCB(json) {
                this.closeEdit(true);
            },
            closeEdit(isSuccess) {
                this.$refs['productForm'].resetFields();
                this.$root.eventHub.$emit('closeEditDialog', isSuccess);
            }
        }
    }
</script>

